package com.stu.mapper;

import com.stu.pojo.Role;
import com.stu.pojo.User;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper{
    @Select("SELECT role.* FROM user,role,sys_user_role WHERE user.uid=sys_user_role.uid AND sys_user_role.rid=role.rid AND username=#{username}")
    @ResultType(Role.class)
    List<Role> selectRolesByUsername(String username);

    @Select("SELECT username,password FROM user WHERE username=#{username}")
    @ResultType(User.class)
    User selectUserByUName(String username);
}
